/**************************************************************************/
/*  Copyright (C) School of Software Engineering of USTC, 2012            
/*                                                                        
/*  FILE NAME: dbapi.h                                                    
/*  PRINCIPAL AUTHOR: SA12226114(Xin Zhu), SA12226139(Dan Shu)            
/*  SUBSYSTEM NAME: DB                                                    
/*  MODULE NAME: dbapi                                                    
/*  LANGUAGE: C                                                           
/*  TARGET ENVIRONMENT: Linux                                             
/*  DATE OF FIRST RELEASE: 2012-11-20                                     
/*  DESCRIPTION: Impement of Abstract Interface for Tokyo Cabinet DB API  
/**************************************************************************/





/*****************************************************************
Function Name: db_new
Description: implement a unified database initialize interface for diverse db
Parameter:  void
******************************************************************/
void* db_new(void);


/*****************************************************************
Function Name: db_open
Description: implement a unified database open interface for diverse db
Parameter:  
@db: a pointer to database object
@dbname: a pointer to name of database
******************************************************************/
void db_open(void *db, void *dbname);


/*****************************************************************
Function Name: db_write
Description: implement a unified database write interface for diverse db
Parameter:  
@db: a pointer to database object
@key: a pointer to key 
@value: a pointer to value
******************************************************************/
void db_write(void *db, char *key, char *value);


/*****************************************************************
Function Name: db_read
Description: implement a unified database read interface for diverse db
Parameter:  
@db: a pointer to database object
@key: a pointer to key 
@void *: a pointer to return value
******************************************************************/
void *db_read(void *db, char *key);


/*****************************************************************
Function Name: db_close
Description: implement a unified database close interface for diverse db
Parameter: @db: a pointer to database object
******************************************************************/
void db_close(void *db);


/*****************************************************************
Function Name: db_delete
Description: implement a unified database delete interface for diverse db
Parameter: @db: a pointer to database object
******************************************************************/
void db_delete(void *db);



